import Login from '../views/Login'
import Home from '../views/Home'
import ProductMgr from '../views/product/ProductMgr'
import ProductCate from '../views/product/ProductCate'
import ProductComment from '../views/product/ProductComment'
import UserMgr from '../views/user/UserMgr'
import UserLabel from '../views/user/UserLabel'
import UserLevel from '../views/user/UserLevel'
import Dashboard from '../views/operator/Dashboard'
import {Navigate} from 'react-router-dom'
//编写路由配置的数组
//下面的routes数组，将来会生成<Routes>
const routes=[
    //下面的每一个对象，将来生成<Route>对象
    {
        path:'/login',
        element:<Login/>
    },
    {
        path:'/',
        element:<Navigate to="home"/>
    },
    {
        path:'/home',
        element:<Home/>,
        children:[
            {
                index:true,
                element:<Navigate to="dashboard"/>
            },
            {
                path:'dashboard',
                element:<Dashboard/>   
            },
            {
                path:'productMgr',
                element:<ProductMgr/>
            },
            {
                path:'productCate',
                element:<ProductCate/>
            },
            {
                path:'productComment',
                element:<ProductComment/>
            },
            {
                path:'userMgr',
                element:<UserMgr/>
            },
            {
                path:'userLabel',
                element:<UserLabel/>
            },
            {
                path:'userLevel',
                element:<UserLevel/>
            }
        ]
    }
]
export default routes